package com.jml.config;

import com.MyInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

//定义mvc的配置
@Configuration
public class MyWebApplicationConfigure  extends WebMvcConfigurerAdapter {

	//进行拦截器的注册处理操作  重写该方法
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		//匹配所有的目录路径
		registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**");
		super.addInterceptors(registry);
	}
}
